<?php
/**
 * Dependency more than weight filter
 *
 * PHP version 5
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
require_once 'W/Dependency/Filter/Node/Abstract.php';
/**
 * Dependency more than weight filter
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
class W_Dependency_Filter_MoreThanWeight extends W_Dependency_Filter_Node_Abstract
{
    private $value;

    public function setValue($value)
    {
        $this->value = $value;
        return $this;
    }
    public function isValidNode($node,$data)
    {
        return $this->value <= array_sum($data);
    }
}